<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">基础设置</a></li>
		</ul>
		<form action="{:U('')}" method="post" class="form-horizontal js-ajax-forms edit-form" enctype="multipart/form-data">
			<div class="row-fluid">
				<div class="span9">
					<table class="table table-bordered">
						<tr>
							<th>行政管理员</th>
							<td>
								<select name="" id="" class='select_audit'>
								    <foreach name='admin' item='vo' key='k'>
										<option value="{$k}" openid="{$vo.wx_openid}" {$k == $info[admin_sn] ? selected : ''} >{$vo.ep_name}</option>
								    </foreach>
								</select>
								<input type="hidden" style="width: 200px;" name="post[admin_sn]"  class='sn'  value="{$info.admin_sn}" placeholder="编号"/>
								<input type="hidden" style="width: 200px;" name="post[admin_name]" class='name'   value="{$info.admin_name}" placeholder="姓名"/>
								<input type="hidden" style="width: 200px;" name="post[admin_wx_openid]" class='openid'   value="{$info.admin_wx_openid}" placeholder="姓名"/>
							</td>
						</tr>
						<tr>
							<th>行政部门主管</th>
							<td>
								<select name="" id="" class='select_audit'>
								    <foreach name='admin' item='vo' key='k'>
										<option value="{$k}" openid="{$vo.wx_openid}" {$k == $info[admin_leader_sn] ? selected : ''} >{$vo.ep_name}</option>
								    </foreach>
								</select>
								<input type="hidden" style="width: 200px;" name="post[admin_leader_sn]" class='sn' value="{$info.admin_leader_sn}"  />
								<input type="hidden" style="width: 200px;" name="post[admin_leader_name]" class='name' value="{$info.admin_leader_name}"  />
								<input type="hidden" style="width: 200px;" name="post[admin_leader_wx_openid]" class='openid' value="{$info.admin_leader_wx_openid}"  />
							</td>
						</tr>
						<tr>
							<th>人事管理员</th>
							<td>
								<select name="" id="" class='select_audit'>
								    <foreach name='hr' item='vo' key='k'>
										<option value="{$k}" openid="{$vo.wx_openid}" {$k == $info[hr_sn] ? selected : ''}>{$vo.ep_name}</option>
								    </foreach>
								    <option value="null" openid="" {$info[hr_sn] == 'null' ? selected : ''}>无</option>
								</select>
								<input type="hidden" style="width: 200px;" name="post[hr_sn]" class='sn' value="{$info.hr_sn}"  />
								<input type="hidden" style="width: 200px;" name="post[hr_name]" class='name' value="{$info.hr_name}"  />
								<input type="hidden" style="width: 200px;" name="post[hr_wx_openid]" class='openid' value="{$info.hr_wx_openid}"  />
							</td>
						</tr>
<!-- 						<tr>
							<th>董监高审核人</th>
							<td>
								<input type="text" style="width: 200px;" name="post[boss_sn]" value="{$info.boss_sn}"  />
								<input type="hidden" style="width: 200px;" name="post[boss_name]" value="{$info.boss_name}"  />
							</td>
						</tr> -->
					</table>
				</div>

			</div>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
			</div>
		</form>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js?t={:time()}"></script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
	$('.select_audit').change(function(){
		var _this = $(this);
		var _val = _this.val();
		var _name = _this.find("option:selected").text();
		var _openid = _this.find("option:selected").attr('openid');
		_this.parent().find('.sn').val(_val)
		_this.parent().find('.name').val(_name)
		_this.parent().find('.openid').val(_openid)
	})
	
	
	 validateForm({
	      rule:{
	  		'post[admin_sn]' : {required : 1},
	  		'post[hr_sn]' : {required : 1},
	  		},
	      message:{
		'post[admin_sn]' : {required : '请设置行政审核负责人'},
		'post[hr_sn]' : {required : '请设置人事审核负责人'},
		}
	 },"{:U('Employee/index')}")
	 
	    
	 </script>
</body>
</html>